#include <iostream>

/**
 * C++ 多继承
 */

//基类
class Shape{
protected:
    int width;
    int height;
public:
    void setWidth(int w){
        width = w;
    }
    void setHeight(int h){
        height = h;
    }
};

//基类PaintCost
class PaintCost{
public:
    int getCost(int area){
        return area * 70;
    }
};

//派生类
class Rectangle: public Shape,public PaintCost{
public:
    int getArea(){
        return (width * height);
    }
};

int main() {

    Rectangle rectangle;
    int area;

    rectangle.setWidth(5);
    rectangle.setHeight(7);

    //输出对象的面积
    std::cout << "Total area : " << rectangle.getArea() << std::endl;

    //输出面积的总花费
    std::cout << "Total paint cost: $" << rectangle.getCost(rectangle.getArea()) << std::endl;














    return 0;
}
